<template>
  <div class="q-pa-md q-gutter-sm">
    <t-btn label="Maximized" color="primary" @click="dialog = true" />

    <t-dialog
      v-model="dialog"
      persistent
      :maximized="maximizedToggle"
      transition-show="slide-up"
      transition-hide="slide-down"
    >
      <t-card class="bg-primary text-white">
        <t-bar>
          <t-space />

          <t-btn
            dense
            flat
            icon="minimize"
            @click="maximizedToggle = false"
            :disable="!maximizedToggle"
          >
            <t-tooltip v-if="maximizedToggle" class="bg-white text-primary"
              >Minimize</t-tooltip
            >
          </t-btn>
          <t-btn
            dense
            flat
            icon="crop_square"
            @click="maximizedToggle = true"
            :disable="maximizedToggle"
          >
            <t-tooltip v-if="!maximizedToggle" class="bg-white text-primary"
              >Maximize</t-tooltip
            >
          </t-btn>
          <t-btn dense flat icon="close" v-close-popup>
            <t-tooltip class="bg-white text-primary">Close</t-tooltip>
          </t-btn>
        </t-bar>

        <t-card-section>
          <div class="text-h6">Alert</div>
        </t-card-section>

        <t-card-section class="q-pt-none">
          Lorem ipsum dolor sit amet consectetur adipisicing elit. Rerum
          repellendus sit voluptate voluptas eveniet porro. Rerum blanditiis
          perferendis totam, ea at omnis vel numquam exercitationem aut, natus
          minima, porro labore.
        </t-card-section>
      </t-card>
    </t-dialog>
  </div>
</template>

<script>
  import { ref } from 'vue';

  export default {
    setup() {
      return {
        dialog: ref(false),
        maximizedToggle: ref(true),
      };
    },
  };
</script>
